package com.example.firstboot.service;


import com.example.firstboot.entity.TbCheck;
import com.example.firstboot.mapper.TbCheckMapper;
import com.example.firstboot.mapper.TbMedicineMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminService {

    @Resource
    private TbCheckMapper tbCheckMapper;

    @Resource
    private TbMedicineMapper tbMedicineMapper;


    public TbCheck selectByPrimaryKey(Integer id){
        return tbCheckMapper.selectByPrimaryKey(id);
    }

    public List<TbCheck> findAllCheck() {
        return tbCheckMapper.queryAllCheck();
    }

    public Integer addCheck(String name, String price) {
        return tbCheckMapper.addCheck(name, price);
    }

    public Integer alertCheck(String id, String name, String price) {
        return tbCheckMapper.alertCheck(id, name, price);
    }

    public Integer deleteCheck(String id) {
        return tbCheckMapper.deleteCheck(id);
    }

    public Integer alertMedicine(String id, String name, String price) {
        return tbMedicineMapper.alertMedicine(id, name, price);
    }

    public List<TbCheck> findAllMedicine() {
        return tbMedicineMapper.findAllMedicine();
    }

    public Integer addMedicine(String name, String price) {
        return tbMedicineMapper.addMedicine(name, price);
    }

    public Integer deleteMedicine(String id) {
        return tbMedicineMapper.deleteMedicine(id);
    }
}
